package com.ysxsoft.wdg.ui.activity.login;

import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import com.ysxsoft.wdg.util.delayaction.Valid;
import com.ysxsoft.wdg.util.sp.SharePrefUtils;


/**
 * 登录状态
 */
public class LoginValid implements Valid {
    private Context mContext;
    private int jump;

    public LoginValid(Context context,int jump) {
        mContext = context;
        this.jump = jump;
    }

    @Override
    public boolean check() {
        return !TextUtils.isEmpty(SharePrefUtils.getUserId());
    }

    @Override
    public void doValid() {
        //统一登录入口
        Intent intent = new Intent(mContext, LoginActivity.class);
        intent.putExtra("jump",jump);
        mContext.startActivity(intent);
    }
}
